﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace Ozone.Models
{
    public class AppLog
    {
        public string FContent { set; get; }
        public string FDate { set; get; }
        public Visibility InfoFlag { set; get; }
        public Visibility WarningFlag { set; get; }
        public Visibility ErrorFlag { set; get; }

        public int MsgType { set; get; }

        public AppLog(int nMsgType, string Content)
        {
            MsgType = nMsgType;
            InfoFlag = Visibility.Collapsed;
            WarningFlag = Visibility.Collapsed;
            ErrorFlag = Visibility.Collapsed;

            FContent = Content;
            FDate = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            if (nMsgType == 0)
                InfoFlag = Visibility.Visible;
            if (nMsgType == 1)
                WarningFlag = Visibility.Visible;
            if (nMsgType == 2)
                ErrorFlag = Visibility.Visible;
        }

        public AppLog(AppLog log)
        {
            FContent = log.FContent;
            FDate = log.FDate;

            InfoFlag = log.InfoFlag;
            WarningFlag = log.WarningFlag;
            ErrorFlag = log.ErrorFlag;

        }
    }
}
